|
|
|
|
|
|
|
LISTING 21.3. PASSARG.TXTUSING PROPERTIES TO PASS ARGUMENTS BETWEEN DOCUMENTS. |
|
|
|
 |
|
|
|
|
1: Private Sub docSecondFrm_Show()
2: If Not docBag Is Nothing Then
3: Text1.Text = docBag.strProp
4: Set docBag = Nothing
5: End If
6: End Sub |
|
|
|
|
|
|
|
|
Now, rerun the application and test it from your Web browser. Enter some text in the text box and then click the command button to display the next document. The second document should be displayed with the text that you have just entered in the first documents text box. |
|
|
|
|
|
|
|
|
Using the Hyperlink Object |
|
|
|
|
|
|
|
|
One object of extreme importance in ActiveX documents is the Hyperlink object. This object has no properties and only three methods. However, the Hyperlink object is what enables an ActiveX document to call other ActiveX documents or to navigate to a Web site. The following are the three methods of the Hyperlink object: |
|
|
|
|
|
|
|
|
NavigateTo-This method causes the container holding the ActiveX document to jump to a file or URL specified in the method. This is the method to use to move from one ActiveX document to another. |
|
|
|
|
|
|
|
|
GoBack-This method performs a hyperlink jump to the previous document in the history list of a container. |
|
|
|
|
|
|
|
|
GoForward-This method causes the container to move to the next document in the history list. |
|
|
|
|
|
|
|
|
Adding Menus to the ActiveX Document.. |
|
|
|
|
|
|
|
|
Using the Menu Editor, you can add a menu to your ActiveX document. However, because an ActiveX document cannot have a menu, the menu you create will be merged with the application you used to view the ActiveX document. Thus, you must consider menu negotiation when adding a menu to an ActiveX document. When users navigate to your ActiveX document, they may not know its origin. To fix this, you should always include an About form with your ActiveX document. |
|
|
|
|
|
|
|
|
Instead of displaying an About box as an ActiveX document, you should display as a standard form using the Show command, as shown in the following code: |
|
|
|
|
|